Searched: \.*
Results from Spoofax web

We keep track of all resolved issues at our YellowGrass issue tracker. Below is an overview of released versions. We also maintain a roadmap of past and future versions.

The Spoofax/IMP Language Workbench

2013

The Spoofax/IMP Language Workbench

2012

The Spoofax/IMP Language Workbench

2011

The Spoofax/IMP Language Workbench

2010

Spoofax

2006

Spoofax

2005

Support for using Spoofax languages outside of Eclipse is provided by Spoofax Sunshine. Usage instructions are available at https://github.com/metaborg/doc/blob/master/spoofax/sunshine/sunshine.md.

The Spoofax project consists of the following components:

Spoofax/IMP

IMP

Stratego

Stratego/J

STRJ

SDF

JSGLR
Aster

Using Maven Tycho

Spoofax project can be built continuously using a combination of Maven, Tycho and Ant. Using Maven should make it easy to run it in a continuous build server like Hudson. We use the same techniques described here in our continuous builds on Hydra.

Make sure you have the following software installed:

  • Maven 3.0
  • Ant
  • Eclipse with Spoofax installed

For this example we assume you have installed eclipse in $ECLIPSE.

This description is based on the following Nix expression we use in our continuous builds:

Installing Spoofax from command-line

You can install Eclipse and Spoofax like described here. However, in a continuous build/integration setting it is sometimes useful to be able to perform these actions from the command-line. Note that this script uses the Spoofax unstable update site.

cd $ECLIPSE

# remove vm args
sed -i 's|-Xms[0-9]*m||' eclipse.ini
sed -i 's|-Xss[0-9]*m||' eclipse.ini
sed -i 's|-Xmx[0-9]*m||' eclipse.ini
sed -i 's|-XX:MaxPermSize=[0-9]*m||' eclipse.ini
sed -i '/^$/d' eclipse.ini
perl -pi -e "s/^\r\n//" eclipse.ini

# add own default vmwargs
echo "-Xms256m" >> eclipse.ini
echo "-Xss8m" >> eclipse.ini
echo "-Xmx1024m" >> eclipse.ini
echo "-XX:MaxPermSize=256m" >> eclipse.ini
echo "-server" >> eclipse.ini

# install spoofax
ALL_SITES="http://spoofax.org/update/unstable"
java -Xmx512m -jar plugins/org.eclipse.equinox.launcher_*.jar       -application org.eclipse.equinox.p2.director      -metadataRepository $ALL_SITES      -artifactRepository $ALL_SITES      -installIU org.strategoxt.imp.feature.group      -data ../data      -consolelog

Setting up Maven

Create a directory with the editor plugin project, feature project and update site project in it.

Then issue the following command (replace version and groupId with something appropriate) to generate the maven pom.xml files:

mvn org.sonatype.tycho:maven-tycho-plugin:generate-poms -Dversion=1.0-SNAPSHOT -DgroupId=mygroup -Dtycho.targetPlatform=$ECLIPSE

If you want to run tests, like JUnit tests, make sure you add org.junit4 to your plugin dependencies and MANIFEST.MF. If your tests reside in your main plugin, you will need to edit the generated pom.xml file of that plugin. Replace,

  <packaging>eclipse-plugin</packaging>
by,
  <packaging>eclipse-test-plugin</packaging>

If you have your tests in a seperate plugin which name ends with tests, Tycho should recognize this and change the packaging element for you.

Running ant builds

Before running Maven you need to use build.main.xml of the Spoofax project(s) to generate some code/files that spoofax normally generates automatically from Eclipse (parsetables, java code from stratego, etc.)


export LOCALCLASSPATH="utils/aster.jar:utils/make_permissive.jar:utils/sdf2imp.jar:utils/strategoxt.jar"
export ANT_OPTS="-Xss8m -Xmx2048m"
export PATH=$PATH:$ECLIPSE/plugins/org.strategoxt.imp.nativebundle_*/native/linux/

for d in */build.main.xml ; do
  cd `dirname $d`
  mkdir -p utils 
  cp -Rv `find $ECLIPSE -name strategoxt.jar` utils/
  cp -Rv `find $ECLIPSE -name aster.jar` utils/
  cp -Rv `find $ECLIPSE -name sdf2imp.jar` utils/
  cp -Rv `find $ECLIPSE -name make_permissive.jar` utils/
  ant -f build.main.xml -Declipse.spoofaximp.jars=utils all
  cd ..
done

Running Maven build

When this is done, the project can be built using:

mvn package -Dtycho.targetPlatform=$ECLIPSE -e

If this is done successfully, you should have an update site available in your update site project directory.

If you would like to run the testsuites perform:

mvn integration-test -Dtycho.targetPlatform=$ECLIPSE -e

Debugging Stratego in Spoofax Projects

Spoofax supports debugging of Stratego code used in the implementation of the various editor services. The Stratego debugger re-uses the Eclipse Debug Perspective making debugging Stratego code similair to debugging Java code.

Debugging can be enabled/disabled per project as it has a negative impact on the performance. The debugger has to be enabled for two components: (1) enable debug instrumentation in the ant build file and (2) enable the debug mode for the runtime.

Currently, debugging support is only available in the nightly builds of Spoofax, use http://spoofax.org/update/nightly as the Eclipse Update site.

Enable Debug Instrumentation

First, to enable debug instrumentation add a file called .debugmode in the project directory. Adding this file will make sure the project is build with debug information.

Second, change the provider in the Builders.esv file from ctree to jar.

And third, change the "all" ant target from

<target name="all" depends="spoofaximp.default"/>
to
<target name="all" depends="spoofaximp.default.jar"/>

Now rebuild the project. After a succesful build the trans-debug directory contains the stratego files from the trans directory instrumented with debug information. The instrumented stratego files are compiled to a jar file that is located in the include directory.

Enable Debug Runtime

Although the project is build with debug information the debug mode still has to be enabled. It is wise to only enable debug mode when it is really needed as it has a huge impact on the performance. Disabling debug mode will still instrument the stratego code, but any breakpoints are ignored.

Select a DSL file (probably in the test directory of the project). Select Enable debug mode from the Transform menu to enable stratego debugging for this Spoofax project.

enable-debug-mode-menu.png

Sometimes the project will rebuild. Check if the debug mode was actually enabled by clicking on the Transform menu, the Enable debug mode menu item should have changed to Disable debug mode. If not select the Enable debug mode menu item again.

Now open a stratego file and set a breakpoint.

breakpoint-in-editor.png

When this breakpoint is hit Eclipse switches to the Debug View and the execution is suspended.

debug-view-overview.png

The variables window shows the available variables, the current term (*current*) and the names of the dynamic rules that are available (*dynamic rules*).

variables.png

Also, you can control the execution of the program with Step Into (F5), Step Over (F6), Step Return (F7) and Resume (F8).

execution-control.png

-- RickyLindeman - 22 Jun 2011

Spoofax Contributors

Source code

The sources of the Spoofax/IMP are available from Subversion.

Continuous build

Eclipse update site with the latest result from SVN trunk. You don't want this. Just for testing.

License

Spoofax/IMP is licensed under the GNU Lesser General Public License (LGPL).

Collaboration

The Spoofax developers usually hang out at the #spoofax IRC channel on FreeNode (web version). Feel free to drop by!

Spoofax: ontwikkeling van domein-specifieke talen in Eclipse

Zie ook de sessiebeschrijving op de devnology website.

Installatie

Installeer voor deze sessie een van de volgende Eclipse installaties met Spoofax voorgeinstalleerd:

Eclipse 3.6 + Spoofax voor Linux

Eclipse 3.6 + Spoofax voor Linux 64-bits

Eclipse 3.6 + Spoofax voor Mac 64-bits (oudere Macs: Eclipse 3.6 + Spoofax)

Eclipse 3.6 + Spoofax voor Windows (Windows 64-bits: Eclipse 3.6 + Spoofax)

Tutorial materiaal

Handout? (pdf)

Eclipse projects? (volg de handout en importeer het initiele project Calculang0 in de Eclipse workspace)

Supporting material and documentation:

  • Editor service descriptors are documented in generated Spoofax files (e.g., YourLang-Colorer.generated.esv)

For direct support please see our Support page.

Example eclipse.ini file, taken from an OS X system:

-startup
../../../plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.0.v20100503
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xss8m
-Xms256m
-Xmx1024m
-XX:MaxPermSize=256m
-server
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Djava.net.preferIPv4Stack=true

Note that every option appears on a separate line, with no following spaces, and that the memory options appear after the -vmargs option. The -Xmx and -Xms options replace corresponding options that may have been in the existing file. Setting these options ensures that Eclipse has sufficient memory to dynamically load editors and is prepared for a full meta-programming environment.

(back to download page)

EntityLang (tour with screenshots)

The EntityLang language shows some of the Spoofax basics, and comes with a short tutorial and screenshots. A basic version of language is included in the "new project" wizard.

Tour

Calculang

A simple calculator language, illustrating basic syntax and transformations.

https://svn.strategoxt.org/repos/StrategoXT/spoofax-contrib/calculang/

NWL

Based on the WebDSL language, NWL is a pedagogical language definition.

NWL source code

Mobl

Mobl is a language for programming mobile phones.

mobl.png

http://mobl-lang.org

https://github.com/mobl/mobl

Lua

Lua is a dynamically typed, lightweight, embeddable scripting language. Spoofax-Lua is an Eclipse plugin for Lua built using Spoofax, featuring reference resolving, type analysis and content assist.

https://github.com/tvo/spoofax-lua#readme

Updates of Spoofax cause Eclipse to time out; why?

Due to a known problem with the combination of Eclipse 3.7, Java 1.7, and Windows, the update manager can be very slow or time out when downloading plugins. As a workaround, you can add the option -Djava.net.preferIPv4Stack=true to your eclipse.ini file, as described on the Download page.

Sometimes Spoofax says "see error log." Where can I find it?

Go to Window > Show view > Error log.

Which files of a language project should I check into my SVN/CVS/GIT/etc. version management system?

You should check in all files, except for the bin and include distribution directories. Some Spoofax projects also have a utils directory that does not have to be checked in. Be sure to check in the hidden files/directories that Eclipse maintains (.project, .classpath, and .externalToolBuilders). If you use an Eclipse plugin such as Subclipse, it'll check these files in automatically. If you want, you can skip some of the .generated files, but at this point the build.generated.xml and lib/editor-common.generated.str files are required to build the project.

How can I compile my Stratego specification to a JAR file instead of an interpreted ctree?

In your build.main.xml file, change this line:

<target name="all" depends="spoofaximp.default.ctree"/>
into
<target name="all" depends="spoofaximp.default.jar"/>
Then in your editor/YourLanguage-Builders.esv, change the provider from provider: include/yourlang.ctree to provider: include/yourlang.jar. (There may already be a provider: include/yourlang-java.jar entry there.) When you distribute your plugin, be sure you set the "unpack" option to "true" for your plugin.

How do I deploy my language plugin to other users?

Either distribute it in source form to other Spoofax users, or follow the steps of our Tour to distribute it as an Eclipse plugin that does not require an existing installation of Spoofax.

How can I use Spoofax with C-based Stratego projects?

Stratego projects written with the C version of Stratego typically have a very different project structure from the one employed by Spoofax projects. To migrate these projects to Spoofax, we advise users to create a new Spoofax project with a wizard and adapt the existing project to this structure. The `build.main.xml` file can be used to set any Stratego options and file locations for use with the Ant build system. Also see the next question.

How can I suppress errors in the Stratego editor in legacy Stratego projects?

Add a file called `.disable-global-analysis` to disable all non-local errors. Any local errors such as missing local variables will still be reported, but non-local errors such as missing strategies or constructors will then be ignored. Use `.warn-global-analysis` to print warnings instead for non-local errors.

If I have two versions of the same language in my workspace, which one will be used?

If you have two versions of a language (e.g., one version installed as a plugin and another loaded from source), the last version that you loaded "wins." Any Java components loaded using the default Eclipse plugin system can only be loaded from installed.

How can I call Java methods from my editor?

See The Tour: Adding Java components.

When does Eclipse show the Spoofax console?

The Spoofax console can be used to print debugging messages. It is only shown for editors that have been dynamically loaded from source; not for editors that are deployed to end users.

How do I debug my Stratego code?

Stratego does not have a stepping debugger at this point. Instead, you can try <debug(!"some message)> x to print a message in the console with the value of term x, or just debug(!"some message") to print the message and the current term. You can also use the with keyword in rewrite rules as follows:

rewrite: x -> x'
with
  x' := <s> ....

which ensures that a stack trace is printed when the body of the with fails (e.g., because s cannot be applied).

How can I output multiple files from a Stratego rule?

You can write directly to a file as follows:

handle := <fopen> ("somefilename.ext", "w");
<fputs> ("file contents string", handle);
fclose

If you use this API from a builder or on save rule, you can change it to the following form to ensure it only writes files statements like the above:

generate-java:
  (selected, position, ast, path, project-path) -> None()

How can I use concrete syntax with Spoofax?

See YellowGrass issue 55.

When I hit "build project" nothing seems to happen? What's wrong?

Eclipse must have decided that you already ran the Ant file that controls the build. Just edit and save one of the files in the project and try again.

Eclipse gets very slow after using it for some time or when opening many editors

The most common cause of this is a lack of heap memory. The default Eclipse setting of 256M (or 512M for 64-bit systems) is very small, even for casual Eclipse users. Please configure your Eclipse installation to use more memory.

How can I refresh a file when Eclipse won't respond to F5?

This seems to be a common issue in Eclipse. Instead of pressing F5, right-click on the file in the package explorer and select "Refresh".

When implementing content proposals, what to do when I get a NOCONTEXT term?

The NOCONTEXT term indicates that the parser is unable to construct a valid abstract syntax tree that corresponds to the grammar, for the part of the tree where content completion is triggered. You can add additional rules to the grammar to help it make a (partial) tree for these cases, as documented on the mailing list. This is an area for future improvement. Don't hesitate to ask further questions about this topic!

Where can I find the latest bleeding edge versions of Spoofax?

The very latest builds of Spoofax can be downloaded by configuring Eclipse to use the http://download.spoofax.org/update/nightly update site. These versions are frequently updated, haven't undergone extensive testing, and may break existing features. If you run into any problems with the nightly releases, make sure you run the latest version and report the bug with the version number used in the issue tracker. Current resolved and unresolved issues for the nightly builds are listed in the roadmap.

"Artifact not found" during installation?

Eclipse can report this error when it tries to download an older version of Spoofax that is no longer available. (This can especially occur with the nightly builds.) Restarting Eclipse or going to the "available update sites" dialog and refreshing or deleting and re-adding the update site should solve this problem.

How do I report a deadlock?

See how to report a deadlock in the Eclipse wiki.

How do I call Java functions from Stratego?

You have to wrap them as Stratego strategies. If you generate a new project, the editor/java/YOURLANGUAGE/strategies/java_strategy_0_0.java class gives an example. If you want to add strategies to an existing Spoofax project, you can add further strategy classes to the same directory:

  • Create a new class that extends `Strategy`, following the template of `java_strategy_0_0.java`
  • Add a reference to that class in InteropRegisterer.java

Where can I find answers to some of my other questions?

Maybe our documentation can answer your question. Otherwise, the YellowGrass issue tracker lists issue reports and questions from other users. You can add your own question there, or contact us directly.















Edit and use your language in one Eclipse window side-by-side.png
Deploy your editor as a portable Eclipse plugin exporting.png
Specify custom errors, warnings, and notes error-marking.png
Support content completion content-completion.png
Support reference resolving reference-resolving.png
Use concise rewrite rules for code generation
rewrite-rules.png
Generate code directly from any editor or selection
code-generation.png
Apply refactoring transformations on the source code
refactoring-support.png
Get a live abstract syntax view
show-abstract-syntax.png

Other features, including:

  • Runs on Windows, Linux, and Mac OS X

  • Bracket highlighting, comment insertion

  • Automatic bracket insertion and automatic indentation

  • Creates a basic, customizable editor using just the grammar

  • Using SDF and SGLR, all context-free languages are supported. This means that language definitions can be composed and reused.

  • Based on the Eclipse IMP framework, allowing interoperability with pure-Java editor components
See Spoofax web home instead.

This page reports on the Interactive Disambiguation project.

We currently implemented a stand-alone grammar generator and disambiguation suggestions tool, available from

https://svn.strategoxt.org/repos/StrategoXT/experimental/meta-amb-suggestions.

Both will be integrated into a near-future version of the Spoofax language workbench. Spoofax already supports concrete object syntax in meta programs, but still requires manual disambiguation of ambiguous quotations and anti-quotations. With this project we aim to address this issue, making meta programming with concrete syntax easier and more fun.

Submission

The submission to LWC 2011 is available as a PDF file: LWCTask-1.0-Spoofax.pdf?. The sources of the project are available via subversion at https://svn.strategoxt.org/repos/StrategoXT/spoofax-contrib/Lawoco and https://svn.strategoxt.org/repos/StrategoXT/spoofax-contrib/DatabaseLang. These projects require Spoofax 0.6.1 or higher, which is currently available from the "unstable" update site at http://lclnet.nl/update/unstable

The screenshot below illustrates the basic syntax definition (left) of the language, an example program (upper right), and its abstract syntax (lower right).

screenshot.png

Spoofax 1.1 released

We are happy to announce the release of Spoofax 1.1! This is the first major release since version 1.0.2 and includes major features and improvements. Spoofax 1.1 supports all current Eclipse versions, up to version 4.2.2.

You can update your Eclipse from http://download.spoofax.org/update/stable

One of the most important improvements in Spoofax 1.1 is the inclusion of NaBL, the Spoofax Name Binding Language. NaBL is used in all new projects created and significantly simplifies name binding analysis, as well as any editor services that depend on it (e.g., code completion, reference resolving)

NaBL is documented at the following pages:

Other highlights of the 1.1 release include:

And there were a number of notable changes under the hood:

A comprehensive list of changes can be viewed at http://yellowgrass.org/tag/Spoofax/1.1.

2013-01-28

Spoofax Q&A

We have started a Q&A site for Spoofax to build a knowledge base of common questions and answers. Join us at http://yellowgrass.org/questions/Spoofax

2012-02-15

Spoofax 1.0.2 maintenance release

Today we're releasing a minor maintenance release of Spoofax, version 1.0.2. This release fixes a memory leak that was introduced in the 1.0 release. There are no new features in this release, those will be included in the upcoming 1.1 release instead. The new version is now available from the update site at http://spoofax.org/update/stable.

2011-12-28

Spoofax 1.0

We're pleased to announce the release of Spoofax 1.0. A number of significant new features have been added since the last stable release, a long list of bugs has been fixed, and various minor improvements were introduced.

Highlights of the release include:

The new version is now available from the update site at http://spoofax.org/update/stable.

In addition to these features, we're actively working on improving Spoofax with new features. In particular, we are now working on providing full support for debugging, on an interactive shell for Stratego and custom languages, and a new meta-language called SpoofaxLang to define languages in a more modular fashion.

A full list of feature requests and issues addressed in the new version is provided at http://yellowgrass.org/tag/Spoofax/1.0.

Refactorings

Spoofax helps you to enrich your editor with refactorings. You can find the refactorings in the context menu of the file being edited.

refactoring-in-editor.png

Refactoring Specifications

The EntityLang-Builders.esv file in the editor directory defines the entries in the Refactor menu:

refactoring-builder.png

The given refactoring specifies the "Rename" menu item, which is enabled in case an ID node is selected.The menu action is bind to the rename shortcut (Shift+Alt+R). After the user applies the rename refactoring, a dialog is prompted with an input field labeled "New name" that has the empty string as initial value.

refactoring-rename-dialog.png

The OK button of the dialog triggers the action defined with the rename rule that we discuss in the next paragraph.


Refactoring Transformations

Refactorings are defined in Stratego. The refactor.str file in the trans directory defines the renaming refactoring for the entity language.

refactor-rule.png

This rule follows a fixed interface for interoperability with the editor. The left-hand-side of the rule is a tuple of: the result of the user input dialog, the selected node, its tree position, the complete ast of the file, the file path and the project path. The right-hand-side is a tuple containing the refactoring output: a list of node changes, plus lists with errors and warnings that will be reported to the user. Errors and warnings are specified as a tuple of the offending language element (which location will be reported) and the error message itself.

refactoring-semantic-error.png

Tip: multiple-file refactorings can be specified in the change list using the root nodes: [(ast-1-before, ast-1-after), (ast-2-before, ast-2-after), ...]


Publications

See also the publication list on researchr

The Spoofax Language Workbench

  • Ricky T. Lindeman, Lennart C. L. Kats, Eelco Visser. Declaratively Defining Domain-Specific Language Debuggers In Ewen Denney, Ulrik Pagh Schultz, editors, Proceedings of the Generative Programming and Component Engineering, 7th International Conference (GPCE 2011), ACM, 2011. (abstract) (pdf) (bib)

  • Lennart C. L. Kats, Karl T. Kalleberg, Eelco Visser. Domain-Specific Languages for Composable Editor Plugins. In Proceedings of the Ninth Workshop on Language Descriptions, Tools, and Applications (LDTA'09), Electronic Notes in Theoretical Computer Science. York, United Kingdom, March 2009. (abstract) (pdf) (bib)

Spoofax components

  • Maartje de Jonge, Eelco Visser. An Algorithm for Layout Preservation in Refactoring Transformations. In Proceedings of Software Language Engineering (SLE 2011), Lecture Notes in Computer Science, Springer, 2011. (To appear.) (pdf)

  • Lennart C. L. Kats, Eelco Visser. Encapsulating Software Platform Logic by Aspect-Oriented Programming: A Case Study in Using Aspects for Language Portability. In IEEE International Working Conference on Source Code Analysis and Manipulation 2010 (SCAM 2010), IEEE, 2010. (abstract) (pdf) (bib)

The original Spoofax editor

(the following paper relates to the original Spoofax SDF and Stratego editor, not the Spoofax/IMP language workbench)

  • Karl T. Kalleberg and Eelco Visser. Spoofax: An Interactive Development Environment for Program Transformation with Stratego/XT. In T. Sloane and A. Johnstone, editors, Seventh Workshop on Language Descriptions, Tools, and Applications (LDTA 2007), ENTCS, pages 47--50, Braga, Portugal, March 2007. Elsevier.

Presentations

Introduction

The semantic index is a set of stratego libraries, java primitives and editor extensions that provide a language-parametric framework for doing name binding, scoping, incremental analysis and incremental compilation.

Quick start

To be able to use the index a nightly version of Spoofax is required which can be retrieved from the following update site:
   http://spoofax.org/update/nightly

The simplest place to get an example on what the index can do and how a project using the index looks like is generating a new Spoofax project. Go to File->New->Project, choose "Spoofax editor project" and fill in Entity as the language name. This will generate and build a Spoofax example project for you that uses the index. To test it out open up test/example.ent and try some things like resolving a reference, code completion and introducing errors by changing types to types that do not exist. These features are all provided by the index using naming annotations in the SDF file and Stratego code to fill in some gaps in the generic algorithm. The tutorial will go into more detail on how to define these things yourself.

More complex examples using the index are also available. We've prototyped a mini C# subset, a C subset without macros and the entity language with functions and aspects using the index. To get these examples download this archive?, extract it somewhere, import the projects into an Eclipse workspace and build all projects (ctr+b).

Tutorial

In this tutorial we will explain how the example entity language uses the index and how to extend it with functions and simple expressions.

Analysis

Name annotations

If you look at the entity language SDF definition below you will see that it has naming annotations on certain terminals (Type@=, Type@, etc) and scope annotations on productions (scope(Type)).
    "module" Module@=ID Definition*       -> Start {"Module", scope(Type)}
    "entity" Type@=ID "{" Property* "}"   -> Definition {"Entity", scope(Property)}
    Property@=ID ":" Type                 -> Property {"Property"}
    Type@ID                               -> Type {"Type"}

Adjust rules

Error checking

Incremental analysis

Compilation

Inner workings

Extension points

FAQ

Where can I find API documentation?

How to fix build error x?

Web TWiki Site Map Use to...
Main Home of Main web Search Main web Recent changes in the Main web Get notified of changes to the Main web The Main web is dedicated to the maintenance of this website. This is the place to discuss meta-issues such as what style to use, how best to organize a survey, what the ideal topic size is, how to refer to papers, what the preferred layout of the site should be, etc. ...
TWiki Home of TWiki web Search TWiki web Recent changes in the TWiki web Get notified of changes to the TWiki web Welcome, Registration, and other StartingPoints; TWiki history & Wiki style; All the docs... ...discover TWiki details, and how to start your own site.
Gmt Home of Gmt web Search Gmt web Recent changes in the Gmt web Get notified of changes to the Gmt web Generative Model Transformer
Gpce Home of Gpce web Search Gpce web Recent changes in the Gpce web Get notified of changes to the Gpce web
Octave Home of Octave web Search Octave web Recent changes in the Octave web Get notified of changes to the Octave web The Stratego web is the home of Stratego, a language for program transformation based on the paradigm of rewriting strategies. The aim of this language is to provide an expressive and declarative language for expressing all kinds of program transformations. The web includes publications on Stratego, download of the StrategoCompiler, documentation, and descriptions of applications. ...
Sandbox Home of Sandbox web Search Sandbox web Recent changes in the Sandbox web Get notified of changes to the Sandbox web Sandbox test area with all features enabled. ...experiment in an unrestricted hands-on web.
Sdf Home of Sdf web Search Sdf web Recent changes in the Sdf web Get notified of changes to the Sdf web The Sdf web is dedicated to the modular syntax definition formalism SDF. Here you can find implementations, pointers to download pages, syntax definitions for common languages, discussions about new features and implementatios of SDF, and tips and tricks for using the formalism. ...
SdfBackup Home of SdfBackup web Search SdfBackup web Recent changes in the SdfBackup web Get notified of changes to the SdfBackup web The Sdf web is dedicated to the modular syntax definition formalism SDF. Here you can find implementations, pointers to download pages, syntax definitions for common languages, discussions about new features and implementatios of SDF, and tips and tricks for using the formalism. ...
Stratego Home of Stratego web Search Stratego web Recent changes in the Stratego web Get notified of changes to the Stratego web The Stratego web is the home of Stratego, a language for program transformation based on the paradigm of rewriting strategies. The aim of this language is to provide an expressive and declarative language for expressing all kinds of program transformations. The web includes publications on Stratego, download of the StrategoCompiler, documentation, and descriptions of applications. ...
Sts Home of Sts web Search Sts web Recent changes in the Sts web Get notified of changes to the Sts web The Sofware Transformation Systems wiki
Tiger Home of Tiger web Search Tiger web Recent changes in the Tiger web Get notified of changes to the Tiger web Home of the Tiger in Stratego project, which is concerned with the exploration of transformation techniques in compilation using an implementation of a Tiger compiler. ...
Tools Home of Tools web Search Tools web Recent changes in the Tools web Get notified of changes to the Tools web The Tools web is the home of the XT? bundle of program transformation tools. XT is an open framework for program transformation based on the ATerm format for exchange of programs between tools. The bundle includes packages for parsing, pretty-printing, term rewriting, and grammar recovery. It also contains a distribution of the SDF2? GrammarBase?. The OnlinePackageBase is an open collection of packages for program transformation supporting package bundling on demand. ...
Transform Home of Transform web Search Transform web Recent changes in the Transform web Get notified of changes to the Transform web The Transform web is an attempt to get an overview of program transformation research and application. In the first place the web is a collection of resources such as pointers to researchers, conferences, journals, summaries and reviews of papers, and tools for implementing transformation systems. In the second place the Transform web attempts to bring structure in the world of program transformation by means of categories, taxonomies such as the TransformationTaxonomy, and entry points such as the ReengineeringWiki and the DeCompilation page. ...
You can use color coding by web for identification and reference. This table is updated automatically based on WebPreferences settings of the individual webs. Contact webmaster@strategoxt.org if you need a separate collaboration web for your team. See also AdminTools.
Legend of icons:   Home of web = Go to the home of the web
Search web = Search the web
  Recent changes in the web = See recent changes in the web
Get notified of changes to the web = Subscribe to get notified of changes by e-mail
SpoofaxLang is a meta-language that can used to define new languages. It is currently an on-going project at the Delft University of Technology, The Netherlands.

Primary vision of developing this language to define and reuse software languages in a modular and reusable manner to support Software Language Composition. It is one of most the desirable features of Software Language Engineering to enable reusability of the existing language constructs.

"From now on, a main goal in designing a language should be to plan for growth." – Guy Steele: Growing a Language, OOPSLA’98 invited talk.

A language should be designed in such a way that evolving it with respect to different language constructs requires the minimum effort. It is well-known that designing a high quality language requires considerable effort. SpoofaxLang promotes languages as a reusable library with the vision of agile language development. Therefore, the cost of full-blown language can be reduced considerably.

Moreover, providing rich IDE support in language development is another area that will be addressed in this language. SpoofaxLang will be integrated with Spoofax - a language workbench to support various IDE features such as, code highlighting, outliner, various coloring scheme , reference resolving and so on.

Therefore, SpoofaxLang is yet another effort to realize language-oriented programming in a pragmatic way. It can be considered as a mean to achieve modular software language composition.

-- TobiVollebregt - 24 Mar 2012

Spoofax 1.1 -- released February 15, 2013

* NaBL name binding language

* Q&A on YellowGrass?

Download

Documentation

License

Spoofax is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

Support

Despite the disclaimer above we do our best to help users of Spoofax.

Subscribe to the Stratego mailing lists?, in particular the stratego-announce and stratego mailing lists to get announcements of new releases and ask questions about usage of the languages and tools. Also we're interested to know what people are using Stratego/XT for and how it might be improved, so feel free to drop us? a line.


Spoofax 1.1 - released February 15, 2013

Summary of Changes

Full issue list on YellowGrass http://yellowgrass.org/tag/Spoofax/1.1

Publications

NaBL Name Binding Language

A major (we think it is revolutionary) innovation in Spoofax 1.1 is the NaBL name binding language.

Eclipse

  • full support on Eclipse 3.7 and 3.8

Project Building

  • Project > Clean menu now cleans the project

  • Much more of the generated files can now be safely deleted (clean takes care of this)

  • The New Project wizard now supports creation of minimal project instead of full Entity

  • Display warning on start-up if Eclipse is not started with the necessary arguments (stack, heap, permgen)

- The new project wizard now supports creation of minimal project instead of full Entity - Display warning on start-up if Eclipse is not started with the necessary arguments (stack, heap, permgen) - Fixed the issue causing the file associations Eclipse preferences issue to be unusable (http://yellowgrass.org/issue/Spoofax/152) - Spoofax should be used with Eclipse Classic, as it conflicts with Web Tools Platform included in Eclipse for Java Developers. This is detailed in the issue http://yellowgrass.org/issue/Spoofax/620 and there's a note about this at http://strategoxt.org/Spoofax/Download under Incompatibilities. - Selective disable of sometimes broken completions tests in SPT. Issue and workaround described at http://yellowgrass.org/issue/Spoofax/544 - Preliminary support for building projects outside of Eclipse. Should work for most straight-forward projects that do not hook deeply into Eclipse directly. Documented at http://webdsl.org/spoofaxwiki/wiki/cmdline%20builds

Spoofax works best with a clean Eclipse Classic 3.7.2, download and install it here: http://www.eclipse.org/downloads/packages/eclipse-classic-372/indigosr2

Inside eclipse, install the unstable version of Spoofax using the following update site: http://spoofax.org/update/unstable

Documentation

Supporting material and documentation:

  • Editor service descriptors are documented in generated Spoofax files (e.g., YourLang-Colorer.generated.esv)

Open Issues

We maintain a bugtracker with open issues at YellowGrass.org, but if you run into any issues you can also directly contact us (see below).

Community

To get in touch with the Spoofax/Stratego community use the following channels:

  • The Spoofax Q&A provides a database with questions and answers

Feel free to drop by!

About

The "template language" is a language that aims to eliminate redundancy in the specification of grammar, completion templates, and pretty printer. It borrows syntax from SDF and StringTemplate.

Syntax Overview

Template language sections
templates
   t*
Section with templates t*
template options
   o*
Section with options o*
Productions
Sort = < e* > Template with elements e*
Sort.Constructor = < e* > Template with elements e*
Sort = [ e* ] Template with elements e* (alt. brackets)
Sort.Constructor = [ e* ] Template with elements e* (alt. brackets)
Placeholders
<Sort> Placeholder (1)
<Sort?> Optional placeholder (0..1)
<Sort*> Repetition (0..n)
<Sort+> Repetition (1..n)
<Sort*; separator="\n"> Repetition with separator
<Sort; text="hi"> Placeholder with replacement text
<Sort; hide> Placeholder hidden from completion template
Escapes
<\\\'\"\ \t\r\n> Element containing escaped characters
<\u0065> Unicode escape
<\\> Escape next line break
<> No output; layout will be allowed here in the grammar
\<</code>, \>, \[, \], \\ Escaped brackets / backslash (prefer alt. brackets)
Priority specification
context-free priorities
  {left: Exp.Times Exp.Over} >
  {left: Exp.Plus Exp.Minus}
Refer to templates using sort and constructor name
Lexical syntax
lexical syntax
  ID = [A-Za-z] [A-Za-z0-9]*
Lexical syntax similar to SDF
Template options
keyword -/- [A-Za-z0-9] Follow restriction for keywords
tokenize : "()" Layout is allowed around (sequences of) these characters
newlines : none Experimental: generate grammar that requires newline characters.
Possible values: none, separating, leading, trailing

Parsing

For each syntax template there is a simple mapping to a SDF production. The semantics of the parser for the syntax template is given entirely by the generated SDF productions.

  • Literal strings are tokenized on space characters (whitespace, tab). Each token results in one literal in the production. That is, hello world maps to "hello" "world", thus allowing any layout between the two tokens.
  • Additionally, literal strings are tokenized on boundaries between characters from the set given by the tokenize option, and any other characters. That is, if() maps to "if" "(" Exp ")", to allow layout between the if keyword and the parentheses.
  • Placeholders translate literally. If a separator option containing any non-layout characters is given, the placeholder maps to a list with separator.

Unparsing / pretty printing

Overview

The pretty printer that is generated from syntax templates consists of a number of Stratego strategies. Each matches a particular pattern in the AST. If the pattern matches, the strategy (recursively) invokes the pretty printing strategies for the child nodes, and combines the results into a BOX AST. This BOX AST can then be converted to a string using the box2text-string strategy from libstratego-gpp.

For example, for a simple plus-expression syntax template:

  Exp.Plus = <<Exp> + <Exp>> {left}

the pretty printing strategy that may be generated is:

  prettyprint-Exp:
    Plus(a, b) ->
      [ H([SOpt(HS(), "0")], [ <pp-one-Z(prettyprint-Exp)> a, S(" + "), <pp-one-Z(prettyprint-Exp)> b ]) ]

As you can see, the pretty printing strategies return a list of boxes that the caller should wrap in a V or Z box (among other things, that is what pp-one-Z does). The user is responsible for this when invoking one of the prettyprint-* strategies from their code!

All pretty printing strategies that are specific to a symbol are hooked up to one global prettyprint-LanguageName strategy, so that it is easy to pretty print an arbitrary subtree of an AST without knowing the type of the root node in advance:

  prettyprint-LanguageName = prettyprint-Exp

Parenthezation

In Spoofax, it is common to not parse parentheses to an AST node. After all, the fact that parentheses are necessary at some point in an expression can be inferred from the priorities of the operators (which are specified in the grammar) and the structure of the AST. The tool sdf2parenthesize does exactly this, and is integrated into SpoofaxLang? via the parenthesize-LanguageName strategy. Invoking the parenthesize-LanguageName strategy results in the addition of Parenthetical constructors to the AST at every place where the structure of the AST conflicts with the operator priorities specified in the grammar. The generated pretty printer knows how to handle the Parenthetical constructor, because a syntax template for parentheses with the bracket attribute, such as:

  Exp = <(<Exp>)> {bracket}

generates the pretty printing strategy:

  prettyprint-Exp:
    Parenthetical(a) ->
      [ H([SOpt(HS(), "0")], [ S("("), <pp-one-Z(prettyprint-Exp)> a, S(")") ]) ]

How to use

The idiomatic way to invoke the generated pretty printer, including parenthezation, and a conversion to string (with word wrap at the 100th column, if applicable), is:

  prettyprint-LanguageName-string =
    parenthesize-LanguageName
    ; prettyprint-LanguageName
    ; !V([], <id>)
    ; box2text-string(|100)

-- TobiVollebregt - 01 Feb 2012

This short primer shows how to use tests as a basis for language development with Spoofax. As an example project we create a small 'calculator' language that shows many of the basics of language definitions.

The source for our example project is collected in before.zip?. The complete project, with all functionality implemented to make the test cases succeed is collected in after.zip?.

A full description of the testing language can be found in the paper Integrated Language Definition Testing. Enabling Test-Driven Language Development. Presentation slides also show Spoofax testing in action: http://slidesha.re/tYaHQT

A Calculator Language

Our example language supports arithmetic expressions, variables, and assignments. An example:

a = 3
a * 4

Based on this simple language we can write test cases. Doing test-driven development, these can even drive the development of the language, but in this document we focus on the tests.

Tests can be written using a .spt file. Create one in a Spoofax project, and press control-space to get a basic test definition. It will have tests of this form:

test description [[
  a = 3
  a * 4
]] 0 errors

As the example shows, each test can quote a program using [[, [[[ or [[[[ brackets. It can also specify a description for the test, and a condition. This test specifies that 0 semantic errors are expected.

Syntax

Example of tests of the syntax:

test Add [[
  1 + 2
]] parse succeeds

test Abstract syntax (1) [[
  1
]]
  parse to Int("1")

test Abstract syntax (2) [[
  1 * 2
]]
  parse to Mul(Int("1"), _)

test Parentheses [[
  (1 + 2)
]]

These tests specify parse success, compare the abstract syntax of the test input against a pattern, or simply specify that the test should succeed.

Tests can also use concrete syntax to test operator precedence and associativity:

test Multiply and add (1) [[
  1 + 2 * 3
]] parse to Add(_, Mul(_, _))

test Multiply and add (2) [[
  1 + 2 * 3
]] parse to [[
  1 + (2 * 3)
]]

test Add and multiply [[
  1 * 2 + 3
]] parse to [[
  (1 * 2) + 3
]]

test Add and add [[
  1 + 2 + 3
]] parse to [[
  (1 + 2) + 3
]]

Evaluation of expressions

The following tests will run a transformation named calc to test evaluation of expressions:

test Constant [[
  1
]] run calc to "1"

test Add [[
  1 + 1
]] run calc to "2"

test Subexpression [[
  1 + [[2 + 3]]
]] run calc to "5"

Note that the last test in this series uses the [[ ... ]] brackets to make a selection in the test. The calc transformation is evaluated for this selection.

Variables

The following tests exercise the definition of variables:

test Variable [[
  x
]] parse

test Variable [[
  longname
]] parse

test Assignment [[
  x = 4
]] parse

test Multiple statements [[
   x = 1
   y = 2
]] parse to Statements([Assign(_, _), Assign(_, _)])

    Stm*       -> Start {cons("Statements")}
    ID "=" Exp -> Stm {cons("Assign")}
    Exp        -> Stm
    ID         -> Exp {cons("Var")}

test Evaluate multiple statements [[
  1
  2
]] run calc to "2"

  calc:
     Statements(s*) -> last
     where
        s'*  := <map(calc)> s*;
        last := <last> s'*

test Eval constant [[
  PI
]] run calc to "3.14"

  calc:
    Var("PI") -> "3.14"

test Eval multiple variables [[
  x = 2
  y = x * 2 + x
  y
]] run calc to "6"

Editor features

The following test cases test the editor facilities of the language:

test Variable unassigned [[
  y
]] 1 error /unassigned/

This test succeeds if the input has 1 error and it matches the regular expression /unassigned/ (as variable y is unassigned).

test Multiple assignments to same variable [[
  y = 1
  y = 2
  y
]] /multiple/

This test succeeds if there are one or more (error) messages that match /multiple/ (as there are multiple definitions of y).

test Reference resolving (1) [[
  x = 4
  [[x]]
]] resolve

test Reference resolving (2) [[
  [[x]] = 4
  [[x]]
]] resolve #2 to #1

test Content completion [[
  avariable = 1
  [[a]]
]] complete to "avariable"

These test cases test reference resolving and content completion. They use the [[ ... ]] selection mechanic to select parts of the program. The first test case specifies that reference resolving should work for the selection. The second specifies that the second selection should resolve to the first selection. The last test case specifies that the selection should provide a content completion option avariable.

Execution

The Calculang project generates Java code. The following test case tests the output that is returned when the program is compiled and executed:

test 42 [[
  42
]] build generate-result to 42

This page provides a tour of the different features of Spoofax. For additional supporting material and documentation, visit our Documentation page. For a quick overview of features, see the Features page.

Tip: We provide general Spoofax usage tips using boxes like this one throughout this tour.

Installation

Moved to http://metaborg.org/wiki/spoofax/download


Getting Started

To get started, create a new Spoofax/IMP project using the File > New > Project > Spoofax/IMP project wizard.

wizard.png

The wizard creates a new an example language and editor definition. It also opens editors for the crucial parts of these definitions, as illustrated below:

overview.png

Highlighted in blue are components that can be used to customize the language and editor. Key components (show in tabs, from left to right) are the SDF syntax of the language, the main editor descriptor, and the Stratego semantic description. The wizard also opens an editor with an example file that can be used to try out the language editor.

We recommend you glance the files in the project to get an idea of what function they have. The wizard filled in some default content that can be edited. Other files are derived files: in particular, all files with .generated in their name are derived from the language definition. These files should not be edited directly as they are generated every time the project is built.

Tip: To rebuild the language and editor at any point use Project > Build Project (control-alt-B) or right-click on the build.main.xml file and run it using Ant.


The syntax definition

The SDF grammar in the syntax directory defines the syntactic structure of the language:

syntax.png

The easiest way to work with the syntax may be to look at it side-by-side with an example editor, allowing you to experiment with the grammar and a concrete file.

Tip: To show two editors side-by-side in Eclipse, drag their caption to a position adjacent to another editor.

The syntax of the default entities language has four production rules: a start production with the module keyword, and productions for entities, properties, and types. SDF productions take the following format:

p* -> S {a*}

And specify that a pattern p* reduces to a symbol S (sometimes called a sort). Using annotations a*, the abstract syntax and exact behavior of the production may be customized. In particular, we use the cons("Name") to specify that "Name" should be used to label the abstract syntax tree node. The abstract syntax is relevant for code generation and analysis of the language. We revisit this topic further on in this section.

To best get a feel of the SDF grammar formalism, try adding a new production to the language. For example, add a new kind of entity property that has a different (composite) relation to its type:

ID "<>" Type -> Property {cons("CompositeProperty")}

Note how SDF just allows you to add an additional case to the Property symbol. SDF can be used to modularly reuse and extend existing grammars in this fashion. The constructor label "CompositeProperty" is used to uniquely identify this new property relation. To try it out, rebuild your project (using control-alt-B), and use it in the example editor.

Tip: For more information on using the SDF, see the reference manual on the Documentation page.


The abstract syntax

Spoofax can show the abstract syntax of your program as textual terms. These are efficiently stored in memory and allow you to concisely manipulate programs. To inspect the abstract syntax of a file, select Show abstract syntax from the Transform menu:

show-abstract-syntax.png

An extra editor will be opened to the side showing the abstract syntax of your file or selection. Note that the view is updated as the original file is edited.


Presentational editor services

Presentational editor services such as code folding, the outline view, and syntax highlighting are defined using esv files in the editor directory.

Code folding

As an example, we take a look at the definition for code folding:

folding.png

The default EntityLang-Folding.generated.esv file defines folding for the start production (symbol Start, constructor label Module) and for entity definitions.

All editor services follow the same basic structure: they have a definition file (EntityLang-Folding.esv) and a derived file (EntityLang-Folding.generated.esv). The first file can be used to customize the editor. The second file is automatically generated from your grammar, each time the project is built.

Tip: The .generated files document the editor descriptor languages using comments.

Outline view

The outline view of the editor can be customized in the same way as the folding definition:

outline-rules.png

An interesting feature of the outline is that it can be shown in the quick outline view by pressing control-O (command-O on Mac OSX). This allows users to quickly navigate in the file:

quick-outline.png

Syntax highlighting

We can use the EntityLang-Colorer file to customize the generated syntax highlighter:

syntax-highlighting.png


Transformations and code generation

The generate.str file in the trans directory defines code generation rules:

code-generation.png

These generate Java code directly from the abstract syntax of the language. Each takes the following form:

name:
  T1 -> T2
  with
    x := y;
    ...

A rule of this form rewrites a subtree of form T1 to T2. In the optional with clause of the rule, variables can be assigned and other rules can be invoked. Some rules specify a where clause with a condition for the rewrite rule.

The rules in our example directly rewrite to Java code using string interpolation to construct Java as text fragments. String interpolation allows you to combine text with variables. Any indentation you use is preserved in the end result, minus the indentation leading up to the quotation. This means your code looks pretty both when you write it and when it comes out of the generator. You can use string interpolation using the $[ ... ] brackets. Variables can be inserted using brackets without a dollar: [ ... ]. If you want, you can also use any other kind of bracket: {, <, and ( are allowed.

You can try out the transformation using the Transform menu, selecting Generate Java code:

code-generation.png

If you edit the input text, the transformation result will be automatically updated. Try changing the transformation and rebuilding the project.


Advanced transformations

When you implement more complicated transformations you will find that it is easier to use intermediate rewrite rules instead that rewrite entity ASTs to simpler entity ASTs (sometimes called model transformations or desugarings). To accomplish this, you can add additional definitions for the to-java rule, or you can add a new rule with a different name:

simplify-rule.png

This rule rewrites the CompositeProperty we have shown before to a regular property. We can now rebuild the project and try out the transformation. Select a composite entity property in the editor or abstract syntax view and choose Apply custom rule in the Transform menu:

apply-simplify-1.png

When prompted, enter the name of the simplify rule:

apply-simplify-2.png

The result of our transformation is now shown in an a view to the side:

apply-simplify-3.png

To use the simplify rule in our transformation to Java, we must make sure that it is invoked there. The original to-java rule was invoked in entitylang.str, which defines the main interface of our language for the editor:

main-str.png

This rule follows a fixed interface for interoperability with the editor, and gets the node currently selected by the user, its tree position as a list of indices, the complete ast of the file, and the path of the file. As a result, it returns a tuple of a filename that should be generated and its contents.

We can adapt the generate-java rule to call our new simplify rule:

main-str-2.png

We added a new rule to-java-top that first invokes the simplify rule before to-java is invoked. However, when you rebuild the project you will find that this adaptation does not work: the simplify rule cannot be applied to an entire module. Unlike to-java, it is only defined for CompositeProperty.

We can fix our transformation by introducing new definitions for the simplify rule for modules, entities, etc:

simplify-rule-2.png

Unfortunately, this practice quickly becomes tedious and hard to maintain. Stratego also allows us to specify a strategy according to which the rule should be applied in the entire tree. A common strategy is the topdown/try strategy: walk the tree in a topdown fashion, and try to apply it everywhere in the tree where possible:

main-str-3.png

Other useful strategies are map, to apply a rule on a list (e.g., map(simplify)), and innermost, to exhaustively apply a rule, starting at the innermost leaves of a tree.

Tip: For more information on using strategies and rewrite rules in Stratego, see the reference manual and tutorial on the Documentation page.

Customizing the Transform menu

The Transform menu allows you to apply any rule to a file or selection:

code-generation.png

Transform can be used directly in an editor of your language, but also from the abstract syntax of that language.

The EntityLang-Builders.esv file in the editor directory defines the entries in the Transform menu:

builders.png

The corresponding EntityLang-Builders.generated.esv documents the definitions in this file. For this tour, we are interested in the builder definitions, which control the Transform menu items. The first builder specifies the "Generate Java code" item. It indicates that the generate-java rule that we saw before is responsible for this action. Using annotations, it also specifies that this action opens an editor which will be updated in "real time" as the user edits the source of the tranformation. The second builder is a meta builder: it only shows up to developers of the language, not when the plugin is deployed.


Error checking

Any errors in the entities language are reported directly in the editor:

error-marker.png

These errors are specified using check rules in the check.str file in the trans directory:

check-rules.png

Like code generation rules, these rules are really just regular rewrite rules. They match against a particular language element and produce a tuple of the offending language element (where the error marker will be shown) and the error message.

The first definition of constraint-error matches properties where a particular condition holds (note the use of the where keyword): the property type is not "String" or "Int", and using GetEntity (defined below) we can tell that it does not exist in the symbol table.

Refactorings

Spoofax helps you to enrich your editor with refactorings. You can find the refactorings in the context menu of the file being edited.

refactoring-in-editor.png

Refactoring Specifications

The EntityLang-Builders.esv file in the editor directory defines the entries in the Refactor menu:

refactoring-builder.png

The given refactoring specifies the "Rename" menu item, which is enabled in case an ID node is selected.The menu action is bind to the rename shortcut (Shift+Alt+R). After the user applies the rename refactoring, a dialog is prompted with an input field labeled "New name" that has the empty string as initial value.

refactoring-rename-dialog.png

The OK button of the dialog triggers the action defined with the rename rule that we discuss in the next paragraph.


Refactoring Transformations

Refactorings are defined in Stratego. The refactor.str file in the trans directory defines the renaming refactoring for the entity language.

refactor-rule.png

This rule follows a fixed interface for interoperability with the editor. The left-hand-side of the rule is a tuple of: the result of the user input dialog, the selected node, its tree position, the complete ast of the file, the file path and the project path. The right-hand-side is a tuple containing the refactoring output: a list of node changes, plus lists with errors and warnings that will be reported to the user. Errors and warnings are specified as a tuple of the offending language element (which location will be reported) and the error message itself.

refactoring-semantic-error.png

Tip: multiple-file refactorings can be specified in the change list using the root nodes: [(ast-1-before, ast-1-after), (ast-2-before, ast-2-after), ...]


Program analysis

We use a symbol table as the basis for our semantic analysis. Every entity is stored in this table, mapping its name to its definition. This table is defined in the record-entity rule in check.str:

analysis.png

The analyze rule uses the topdown/try strategy we have shown before. It will try to apply the record-entity rule wherever it can. The record-entity rule is applied to all entities: User, BlogPosting, and URL. Stratego provides a concise notation for creating symbol tables: using the rules keyword, we define a new entry for the name 'x' that points to the node in the abstract syntax tree that defines it. We use this definition for error checking, reference resolving, and content completion.


Reference resolving

When a user holds control (or command on Mac OSX) and hovers over an identifier, they get a link to its definition:

reference-resolving.png

Supporting reference resolving is easy once a program analysis is performed. By default, the entities language simply invokes the GetEntity rule to fetch the definition for any Type selected by the user:

reference-resolving.png

This rule follows the same structure as other rules in this file. It first prints a debugging message "Resolve: ...", which shows up in the Eclipse console (but not when the plugin is deployed). It then tries to set a variable type using the node that was just selected by the user. If the node is of the form Type(_), then it will call the GetEntity rule to resolve the declaration of that type. Since editor-resolve uses a where clause, it will only succeed if node is in fact a Type and if GetEntity succeeds. If this is not the case, another definition may of editor-resolve may be used instead, if one exists.


Content completion

Spoofax supports content completion that can be triggered by pressing control-space:

content-completion.png

Content completion can also be triggered when the user enters a particular sequence of characters (like the . in Java). The EntitityLang-Completions.esv allows this behavior to be configured:

content-completion-1.png

This file specifies that content completion should be triggered once users enter ": ". It also says that the editor-complete rule handles the implementation of content completion.

Like other editor services in Spoofax, content completion is implemented at the abstract syntax level. Once content completion is triggered, an AST like the following is created:

content-completion-3.png

In this AST we see a special COMPLETION(_) note where content completion is requested. The editor-complete rule in entity-lang.str provides completion proposals:

content-completion-2.png

This rule gets the current abstract syntax tree node, its position, etc. and returns a list of content proposals. The "String" and "Int" proposal are hardcoded; other proposals are computed by taking all the keys of our GetEntity table. For this we use the all-keys-GetEntity rule which is automatically made available from our GetEntity definition. Spoofax will then automatically show proposals with the right prefix (here the letter "U").


Testing Language Definitions

Spoofax allows you to write tests for your language implementation using a specialized testing language. An example set of tests can be found in test/test-example.spt.

A basic testing module has the following form, specifying the name of a language:

test-basic.png

It specifies the name of the language under test (EntityLang) and one or more test cases. The test case in this module is based on a small EntityLang program enclosed in ? brackets, and specifies that this program should parse to a pattern Module("example", [Entity("User", _)]).

More advanced test cases may use setup blocks to factor out commonalities in test cases, and can specify a wide range of testing conditions:

test-advanced.png

These test cases test for semantic errors (0 errors or 1 error) and test that refactoring works as expected. Notice how the last test case uses the ? brackets to indicate that a rename refactoring is performed on the "User" entity. This test case simulates the renaming of the "User" entity to a "Customer" entity.

Any failing test cases are marked with an error in the editor. The "Transform" menu can also be used to launch a project-wide, graphical test runner:

test-batch.png

Tip: content completion shows more conditions that can be specified for test cases. A full overview is also given in the paper Integrated Language Definition Testing.


Plugin deployment

You can deploy your plugin using the Eclipse update site mechanism. Users do not need to have Spoofax/IMP installed for using your plugin. To create an update site, you need to create a plugin feature project and an update site project.

You can create a new plugin feature project by using the File > New > Project > Plug-in development > Feature Project wizard:

deployment-1.png

In the tab plugins, add your plugin to the list of included features using the "Add" button.

In the tab Included Features you should add Spoofax/IMP. Be sure you select that it can be updated from "both" update sites for maximal compatibility with existing installations and updates:

deployment-4.png

You can then create an update site project. From Overview page of feature.xml, open the New Update Site wizard:

exporting.png

As the name of the update site you may use company.entities.updatesite. In the update site project, create a new category and add the feature project:

deployment-3.png

From here, you can select Build All to build the update site. You can then upload it to a web server and use it to install or update your plugin using the Eclipse update manager.


Adding Java components

Some advanced users may want to add their own Java components to their plugins. Spoofax provides two mechanisms for interoperation with Java and other JVM-based languages. The first mechanism is the standard Eclipse extension mechanism: as the Spoofax framework is based on Java and Eclipse, it allows you to add new, Java-based components as Eclipse extensions. The other mechanism is that it allows users to implement their own strategies (functions that follow the Stratego interface) using Java. This mechanism is documented in the editor/java/.../strategies/java_strategy_0_0.java example strategy included with the default project. Strategies implemented this way can be dynamically loaded just like other Spoofax components.

In this tour we focus on the Eclipse extension mechanism. These components can be added using the Extensions tab of plugin.xml:

java-components-1.png

You can then select Add to add a new extension:

java-components-2.png

Note that only editor components defined using Spoofax/IMP can be used directly in the same Eclipse instance in which they are developed. Normal Eclipse plugins and extensions do not have this feature. You can try your Java-based extensions using the debug or run buttons in the tool bar, launching a new Eclipse instance:

java-components-run.png

A key class for integrating with Spoofax editors from Java org.strategoxt.imp.runtime.EditorState class, which provides things like the current or selection AST of an open editor. It also allows model listeners to be attached using EditorState.getEditor().addModelListener(). Please contact us if you have any questions about Java integration or other topics; we'd be happy to help.

All built-in Spoofax/IMP editor components are based on the Eclipse IMP framework. In addition to standard Eclipse plugin extensions, IMP can also be used to define parts of your editor. These can be created using the File > New wizard, selecting any of the IDE Language Support options. At this time, however, not all these wizards are stable, and they may not always work right within the Spoofax/IMP environment. Instead, we recommend that users build editor services using the Spoofax-native esv definitions or, if necessary, using regular Eclipse extension points.





Topic Changed By
WebLeftBar 11 May 2017 - 05:48 EelcoVisser
CommandLine? 12 Jun 2014 - 09:03 VladVergu
Testing? 13 Sep 2013 - 14:42 EelcoVisser
News? 25 Mar 2013 - 14:42 LennartKats
NBL? 25 Mar 2013 - 10:57 EelcoVisser
Download? 25 Mar 2013 - 10:56 EelcoVisser
ChangeLog? 22 Mar 2013 - 10:40 LennartKats
SpoofaxRelease11? 16 Feb 2013 - 16:40 EelcoVisser
NaBL? 14 Feb 2013 - 20:33 EelcoVisser
DebugStratego? 01 Feb 2013 - 09:14 GuidoWachsmuth
SemanticIndex? 01 Feb 2013 - 09:12 GuidoWachsmuth
ContinuousBuildingSpoofax? 01 Feb 2013 - 09:11 GuidoWachsmuth
Development? 28 Jan 2013 - 13:56 EelcoVisser
Support? 28 Jan 2013 - 13:06 EelcoVisser
Documentation? 22 Oct 2012 - 22:10 EelcoVisser
FAQ? 17 Oct 2012 - 12:28 LennartKats
SummerSchool? 23 Jul 2012 - 06:31 GabrielKonat
TemplateLanguage? 09 Apr 2012 - 04:45 TobiVollebregt
SpoofaxLanguage? 24 Mar 2012 - 14:30 TobiVollebregt
WebHome 24 Feb 2012 - 17:28 LennartKats
Refactorings? 26 Jan 2012 - 13:42 MaartjeDeJonge
ExampleIni? 21 Dec 2011 - 15:16 LennartKats
TestingDemo? 20 Dec 2011 - 14:51 LennartKats
Research? 18 Dec 2011 - 08:20 MaartjeDeJonge
Tour? 28 Nov 2011 - 14:37 LennartKats
Features? 27 Nov 2011 - 00:57 MaartjeDeJonge
Examples? 11 Oct 2011 - 16:01 TobiVollebregt
LWC2011? 24 May 2011 - 08:13 LennartKats
LayoutPreservation? 19 Nov 2010 - 21:45 EelcoVisser
Devnology? 06 Nov 2010 - 14:43 LennartKats
InteractiveDisambiguation? 27 Jun 2010 - 22:22 LennartKats
NWL? 06 May 2010 - 11:10 LennartKats
Components? 31 Mar 2010 - 15:02 LennartKats
IMP? 23 Feb 2010 - 10:23 LennartKats
WebPreferences 12 Feb 2010 - 14:50 LennartKats
WebRss 16 Aug 2004 - 03:27 PeterThoeny
WebSearchAdvanced 18 Jan 2004 - 10:52 PeterThoeny
UpdateWebPages 20 Sep 2002 - 08:37 EelcoVisser
SiteMap 27 Aug 2002 - 08:00 EelcoVisser
WebChanges500 23 Apr 2002 - 20:09 EelcoVisser
WebChanges200 23 Apr 2002 - 20:05 EelcoVisser
WebChanges100 23 Apr 2002 - 19:53 EelcoVisser
WebChanges 23 Apr 2002 - 19:46 EelcoVisser
WebNotify 23 Jan 2002 - 14:21 EelcoVisser
WebIndex 23 Jan 2002 - 14:20 EelcoVisser
WebNews 23 Jan 2002 - 14:17 EelcoVisser
WebTopicList 24 Nov 2001 - 11:40 PeterThoeny
WebTools 08 Nov 2001 - 09:49 TWikiGuest
WebSearch 08 Aug 2001 - 05:26 PeterThoeny
WebStatistics 08 Aug 2001 - 05:25 PeterThoeny

See also

Topic Changed By
WebLeftBar 11 May 2017 - 05:48 EelcoVisser
CommandLine? 12 Jun 2014 - 09:03 VladVergu
Testing? 13 Sep 2013 - 14:42 EelcoVisser
News? 25 Mar 2013 - 14:42 LennartKats
NBL? 25 Mar 2013 - 10:57 EelcoVisser
Download? 25 Mar 2013 - 10:56 EelcoVisser
ChangeLog? 22 Mar 2013 - 10:40 LennartKats
SpoofaxRelease11? 16 Feb 2013 - 16:40 EelcoVisser
NaBL? 14 Feb 2013 - 20:33 EelcoVisser
DebugStratego? 01 Feb 2013 - 09:14 GuidoWachsmuth
SemanticIndex? 01 Feb 2013 - 09:12 GuidoWachsmuth
ContinuousBuildingSpoofax? 01 Feb 2013 - 09:11 GuidoWachsmuth
Development? 28 Jan 2013 - 13:56 EelcoVisser
Support? 28 Jan 2013 - 13:06 EelcoVisser
Documentation? 22 Oct 2012 - 22:10 EelcoVisser
FAQ? 17 Oct 2012 - 12:28 LennartKats
SummerSchool? 23 Jul 2012 - 06:31 GabrielKonat
TemplateLanguage? 09 Apr 2012 - 04:45 TobiVollebregt
SpoofaxLanguage? 24 Mar 2012 - 14:30 TobiVollebregt
WebHome 24 Feb 2012 - 17:28 LennartKats
Refactorings? 26 Jan 2012 - 13:42 MaartjeDeJonge
ExampleIni? 21 Dec 2011 - 15:16 LennartKats
TestingDemo? 20 Dec 2011 - 14:51 LennartKats
Research? 18 Dec 2011 - 08:20 MaartjeDeJonge
Tour? 28 Nov 2011 - 14:37 LennartKats
Features? 27 Nov 2011 - 00:57 MaartjeDeJonge
Examples? 11 Oct 2011 - 16:01 TobiVollebregt
LWC2011? 24 May 2011 - 08:13 LennartKats
LayoutPreservation? 19 Nov 2010 - 21:45 EelcoVisser
Devnology? 06 Nov 2010 - 14:43 LennartKats
InteractiveDisambiguation? 27 Jun 2010 - 22:22 LennartKats
NWL? 06 May 2010 - 11:10 LennartKats
Components? 31 Mar 2010 - 15:02 LennartKats
IMP? 23 Feb 2010 - 10:23 LennartKats
WebPreferences 12 Feb 2010 - 14:50 LennartKats
WebRss 16 Aug 2004 - 03:27 PeterThoeny
WebSearchAdvanced 18 Jan 2004 - 10:52 PeterThoeny
UpdateWebPages 20 Sep 2002 - 08:37 EelcoVisser
SiteMap 27 Aug 2002 - 08:00 EelcoVisser
WebChanges500 23 Apr 2002 - 20:09 EelcoVisser
WebChanges200 23 Apr 2002 - 20:05 EelcoVisser
WebChanges100 23 Apr 2002 - 19:53 EelcoVisser
WebChanges 23 Apr 2002 - 19:46 EelcoVisser
WebNotify 23 Jan 2002 - 14:21 EelcoVisser
WebIndex 23 Jan 2002 - 14:20 EelcoVisser
WebNews 23 Jan 2002 - 14:17 EelcoVisser
WebTopicList 24 Nov 2001 - 11:40 PeterThoeny
WebTools 08 Nov 2001 - 09:49 TWikiGuest
WebSearch 08 Aug 2001 - 05:26 PeterThoeny
WebStatistics 08 Aug 2001 - 05:25 PeterThoeny
Topic Changed By
WebLeftBar 11 May 2017 - 05:48 EelcoVisser
CommandLine? 12 Jun 2014 - 09:03 VladVergu
Testing? 13 Sep 2013 - 14:42 EelcoVisser
News? 25 Mar 2013 - 14:42 LennartKats
NBL? 25 Mar 2013 - 10:57 EelcoVisser
Download? 25 Mar 2013 - 10:56 EelcoVisser
ChangeLog? 22 Mar 2013 - 10:40 LennartKats
SpoofaxRelease11? 16 Feb 2013 - 16:40 EelcoVisser
NaBL? 14 Feb 2013 - 20:33 EelcoVisser
DebugStratego? 01 Feb 2013 - 09:14 GuidoWachsmuth
SemanticIndex? 01 Feb 2013 - 09:12 GuidoWachsmuth
ContinuousBuildingSpoofax? 01 Feb 2013 - 09:11 GuidoWachsmuth
Development? 28 Jan 2013 - 13:56 EelcoVisser
Support? 28 Jan 2013 - 13:06 EelcoVisser
Documentation? 22 Oct 2012 - 22:10 EelcoVisser
FAQ? 17 Oct 2012 - 12:28 LennartKats
SummerSchool? 23 Jul 2012 - 06:31 GabrielKonat
TemplateLanguage? 09 Apr 2012 - 04:45 TobiVollebregt
SpoofaxLanguage? 24 Mar 2012 - 14:30 TobiVollebregt
WebHome 24 Feb 2012 - 17:28 LennartKats
Refactorings? 26 Jan 2012 - 13:42 MaartjeDeJonge
ExampleIni? 21 Dec 2011 - 15:16 LennartKats
TestingDemo? 20 Dec 2011 - 14:51 LennartKats
Research? 18 Dec 2011 - 08:20 MaartjeDeJonge
Tour? 28 Nov 2011 - 14:37 LennartKats
Features? 27 Nov 2011 - 00:57 MaartjeDeJonge
Examples? 11 Oct 2011 - 16:01 TobiVollebregt
LWC2011? 24 May 2011 - 08:13 LennartKats
LayoutPreservation? 19 Nov 2010 - 21:45 EelcoVisser
Devnology? 06 Nov 2010 - 14:43 LennartKats
InteractiveDisambiguation? 27 Jun 2010 - 22:22 LennartKats
NWL? 06 May 2010 - 11:10 LennartKats
Components? 31 Mar 2010 - 15:02 LennartKats
IMP? 23 Feb 2010 - 10:23 LennartKats
WebPreferences 12 Feb 2010 - 14:50 LennartKats
WebRss 16 Aug 2004 - 03:27 PeterThoeny
WebSearchAdvanced 18 Jan 2004 - 10:52 PeterThoeny
UpdateWebPages 20 Sep 2002 - 08:37 EelcoVisser
SiteMap 27 Aug 2002 - 08:00 EelcoVisser
WebChanges500 23 Apr 2002 - 20:09 EelcoVisser
WebChanges200 23 Apr 2002 - 20:05 EelcoVisser
WebChanges100 23 Apr 2002 - 19:53 EelcoVisser
WebChanges 23 Apr 2002 - 19:46 EelcoVisser
WebNotify 23 Jan 2002 - 14:21 EelcoVisser
WebIndex 23 Jan 2002 - 14:20 EelcoVisser
WebNews 23 Jan 2002 - 14:17 EelcoVisser
WebTopicList 24 Nov 2001 - 11:40 PeterThoeny
WebTools 08 Nov 2001 - 09:49 TWikiGuest
WebSearch 08 Aug 2001 - 05:26 PeterThoeny
WebStatistics 08 Aug 2001 - 05:25 PeterThoeny
Topic Changed By
WebLeftBar 11 May 2017 - 05:48 EelcoVisser
CommandLine? 12 Jun 2014 - 09:03 VladVergu
Testing? 13 Sep 2013 - 14:42 EelcoVisser
News? 25 Mar 2013 - 14:42 LennartKats
NBL? 25 Mar 2013 - 10:57 EelcoVisser
Download? 25 Mar 2013 - 10:56 EelcoVisser
ChangeLog? 22 Mar 2013 - 10:40 LennartKats
SpoofaxRelease11? 16 Feb 2013 - 16:40 EelcoVisser
NaBL? 14 Feb 2013 - 20:33 EelcoVisser
DebugStratego? 01 Feb 2013 - 09:14 GuidoWachsmuth
SemanticIndex? 01 Feb 2013 - 09:12 GuidoWachsmuth
ContinuousBuildingSpoofax? 01 Feb 2013 - 09:11 GuidoWachsmuth
Development? 28 Jan 2013 - 13:56 EelcoVisser
Support? 28 Jan 2013 - 13:06 EelcoVisser
Documentation? 22 Oct 2012 - 22:10 EelcoVisser
FAQ? 17 Oct 2012 - 12:28 LennartKats
SummerSchool? 23 Jul 2012 - 06:31 GabrielKonat
TemplateLanguage? 09 Apr 2012 - 04:45 TobiVollebregt
SpoofaxLanguage? 24 Mar 2012 - 14:30 TobiVollebregt
WebHome 24 Feb 2012 - 17:28 LennartKats
Refactorings? 26 Jan 2012 - 13:42 MaartjeDeJonge
ExampleIni? 21 Dec 2011 - 15:16 LennartKats
TestingDemo? 20 Dec 2011 - 14:51 LennartKats
Research? 18 Dec 2011 - 08:20 MaartjeDeJonge
Tour? 28 Nov 2011 - 14:37 LennartKats
Features? 27 Nov 2011 - 00:57 MaartjeDeJonge
Examples? 11 Oct 2011 - 16:01 TobiVollebregt
LWC2011? 24 May 2011 - 08:13 LennartKats
LayoutPreservation? 19 Nov 2010 - 21:45 EelcoVisser
Devnology? 06 Nov 2010 - 14:43 LennartKats
InteractiveDisambiguation? 27 Jun 2010 - 22:22 LennartKats
NWL? 06 May 2010 - 11:10 LennartKats
Components? 31 Mar 2010 - 15:02 LennartKats
IMP? 23 Feb 2010 - 10:23 LennartKats
WebPreferences 12 Feb 2010 - 14:50 LennartKats
WebRss 16 Aug 2004 - 03:27 PeterThoeny
WebSearchAdvanced 18 Jan 2004 - 10:52 PeterThoeny
UpdateWebPages 20 Sep 2002 - 08:37 EelcoVisser
SiteMap 27 Aug 2002 - 08:00 EelcoVisser
WebChanges500 23 Apr 2002 - 20:09 EelcoVisser
WebChanges200 23 Apr 2002 - 20:05 EelcoVisser
WebChanges100 23 Apr 2002 - 19:53 EelcoVisser
WebChanges 23 Apr 2002 - 19:46 EelcoVisser
WebNotify 23 Jan 2002 - 14:21 EelcoVisser
WebIndex 23 Jan 2002 - 14:20 EelcoVisser
WebNews 23 Jan 2002 - 14:17 EelcoVisser
WebTopicList 24 Nov 2001 - 11:40 PeterThoeny
WebTools 08 Nov 2001 - 09:49 TWikiGuest
WebSearch 08 Aug 2001 - 05:26 PeterThoeny
WebStatistics 08 Aug 2001 - 05:25 PeterThoeny

The Spoofax Language Workbench

Spoofax is a platform for developing textual domain-specific languages with full-featured Eclipse editor plugins.

Installation

With the Spoofax/IMP language workbench, you can write the grammar of your language using the high-level SDF grammar formalism. Based on this grammar, basic editor services such as syntax highlighting and code folding are automatically provided. Using high-level descriptor languages, these services can be customized. More sophisticated services such as error marking and content completion can be specified using rewrite rules in the Stratego language.

News

Spoofax 1.1 released

We are happy to announce the release of Spoofax 1.1! This is the first major release since version 1.0.2 and includes major features and improvements. Spoofax 1.1 supports all current Eclipse versions, up to version 4.2.2.

You can update your Eclipse from http://download.spoofax.org/update/stable

One of the most important improvements in Spoofax 1.1 is the inclusion of NaBL, the Spoofax Name Binding Language. NaBL is used in all new projects created and significantly simplifies name binding analysis, as well as any editor services that depend on it (e.g., code completion, reference resolving)

NaBL is documented at the following pages:

Other highlights of the 1.1 release include:

And there were a number of notable changes under the hood:

A comprehensive list of changes can be viewed at http://yellowgrass.org/tag/Spoofax/1.1.

2013-01-28

Spoofax Q&A

We have started a Q&A site for Spoofax to build a knowledge base of common questions and answers. Join us at http://yellowgrass.org/questions/Spoofax

2012-02-15

Spoofax 1.0.2 maintenance release

Today we're releasing a minor maintenance release of Spoofax, version 1.0.2. This release fixes a memory leak that was introduced in the 1.0 release. There are no new features in this release, those will be included in the upcoming 1.1 release instead. The new version is now available from the update site at http://spoofax.org/update/stable.

2011-12-28

Spoofax 1.0

We're pleased to announce the release of Spoofax 1.0. A number of significant new features have been added since the last stable release, a long list of bugs has been fixed, and various minor improvements were introduced.

Highlights of the release include:

The new version is now available from the update site at http://spoofax.org/update/stable.

In addition to these features, we're actively working on improving Spoofax with new features. In particular, we are now working on providing full support for debugging, on an interactive shell for Stratego and custom languages, and a new meta-language called SpoofaxLang to define languages in a more modular fashion.

A full list of feature requests and issues addressed in the new version is provided at http://yellowgrass.org/tag/Spoofax/1.0.

Features

Edit and use your language in one Eclipse window side-by-side.png
Deploy your editor as a portable Eclipse plugin exporting.png
Specify custom errors, warnings, and notes error-marking.png
Support content completion content-completion.png
Support reference resolving reference-resolving.png
Use concise rewrite rules for code generation
rewrite-rules.png
Generate code directly from any editor or selection
code-generation.png
Apply refactoring transformations on the source code
refactoring-support.png
Get a live abstract syntax view
show-abstract-syntax.png

(more features)



2002-01-23

WebNotify is a subscription service to be automatically notified by email when topics change in the TWiki.Spoofax web. This is a convenient service, so you do not have to come back and check all the time if something has changed. To subscribe to the service, please put yourself on the list below. The format is: 3 spaces * Main.yourWikiName - yourEmailAddress

Note: It is helpful to insert your name in alphabetical order (by first name -- ignore the "Main.") -- then you can find your name (or not) more easily if you wish to remove it or confirm that you are on the list.

Related topics: TWikiUsers, TWikiRegistration

TWiki.Spoofax Web Preferences

The following settings are web preferences of the TWiki.Spoofax web. These preferences overwrite the site-level preferences in TWikiPreferences, and can be overwritten by user preferences (your personal topic, i.e. TWikiGuest in the TWiki.Main web)

Preferences:

  • Web specific background color: (Pick a lighter one of the StandardColors; default FFD8AA)
    • Set WEBBGCOLOR = #FFFFFF
    • Set WEBHEADERBGCOLOR = #FFFFFF

  • Exclude web from a web="all" search: (Set to on for hidden webs)
    • Set NOSEARCHALL =

  • Default template for new topics and form(s) for this web:
    • WebTopicEditTemplate?: Default template for new topics in this web. (Site-level is used if topic does not exist)
    • TWiki.WebTopicEditTemplate: Site-level default template
    • TWikiForms: How to enable form(s)
    • Set WEBFORMS =

  • Users or groups who are not / are allowed to view / change / rename topics in the Spoofax web: (See TWikiAccessControl)
    • Set DENYWEBVIEW =
    • Set ALLOWWEBVIEW =
    • Set DENYWEBCHANGE =
    • Set ALLOWWEBCHANGE = StrategoGroup
    • Set DENYWEBRENAME =
    • Set ALLOWWEBRENAME = StrategoGroup

  • Web preferences that are not allowed to be overridden by user preferences:
    • Set FINALPREFERENCES = WEBTOPICLIST, DENYWEBVIEW, ALLOWWEBVIEW, DENYWEBCHANGE, ALLOWWEBCHANGE, DENYWEBRENAME, ALLOWWEBRENAME

Notes:

  • A preference is defined as:
    6 spaces * Set NAME = value
    Example:
    • Set WEBBGCOLOR = #FFFFC0
  • Preferences are used as TWikiVariables by enclosing the name in percent signs. Example:
    • When you write variable %WEBBGCOLOR% , it gets expanded to #FFFFFF .
  • The sequential order of the preference settings is significant. Define preferences that use other preferences first, i.e. set WEBCOPYRIGHT before WIKIWEBMASTER since %WEBCOPYRIGHT% uses the %WIKIWEBMASTER% variable.
  • You can introduce new preferences variables and use them in your topics and templates. There is no need to change the TWiki engine (Perl scripts).

Related Topics:

TWiki's Spoofax web /view/Spoofax The Spoofax web of TWiki. TWiki is a Web-Based Collaboration Platform for the Corporate World. en-us Copyright 2020 by contributing authors Eelco Visser [webmaster@strategoxt.org] Eelco Visser [webmaster@strategoxt.org] TWiki TWiki.Spoofax TWiki home.Spoofax /view/Spoofax /pub/TWiki/TWikiLogos/twikiRobot46x50.gif WebLeftBar /view/Spoofax/WebLeftBar?t=2017-05-11T05:48Z Spoofax Home Tour and screenshots Documentation Download Research Development Support (last changed by EelcoVisser) 2017-05-11T05:48Z EelcoVisser 1.6 updated major /rdiff/Spoofax/WebLeftBar /rdiff/Spoofax/WebLeftBar CommandLine /view/Spoofax/CommandLine?t=2014-06-12T09:03Z Support for using Spoofax languages outside of Eclipse is provided by Spoofax Sunshine. Usage instructions are available at https://github.com/metaborg/doc/blob/master ... (last changed by VladVergu) 2014-06-12T09:03Z VladVergu 1.3 updated major /rdiff/Spoofax/CommandLine /rdiff/Spoofax/CommandLine Testing /view/Spoofax/Testing?t=2013-09-13T14:42Z This short primer shows how to use tests as a basis for language development with Spoofax. As an example project we create a small 'calculator' language that shows ... (last changed by EelcoVisser) 2013-09-13T14:42Z EelcoVisser 1.3 updated major /rdiff/Spoofax/Testing /rdiff/Spoofax/Testing News /view/Spoofax/News?t=2013-03-25T14:42Z .newsitem h3 { font-size: 100 ; color: #333333; padding-bottom: 3px; border-bottom: 1px dotted #bb9; } .newsitem em { float: right; font-size: x-small; padding-bottom ... (last changed by LennartKats) 2013-03-25T14:42Z LennartKats 1.7 updated major /rdiff/Spoofax/News /rdiff/Spoofax/News NBL /view/Spoofax/NBL?t=2013-03-25T10:57Z Moved to http://metaborg.org/wiki/nabl (last changed by EelcoVisser) 2013-03-25T10:57Z EelcoVisser 1.2 updated major /rdiff/Spoofax/NBL /rdiff/Spoofax/NBL SpoofaxRelease11 /view/Spoofax/SpoofaxRelease11?t=2013-02-16T16:40Z Spoofax 1.1 released February 15, 2013 NaBL name binding language Q A on YellowGrass Download Update sites changed: http://download.spoofax.org/update/stable for ... (last changed by EelcoVisser) 2013-02-16T16:40Z EelcoVisser 1.3 updated major /rdiff/Spoofax/SpoofaxRelease11 /rdiff/Spoofax/SpoofaxRelease11 NaBL /view/Spoofax/NaBL?t=2013-02-14T20:33Z name binding language (last changed by EelcoVisser) 2013-02-14T20:33Z EelcoVisser 1.1 updated major /rdiff/Spoofax/NaBL /rdiff/Spoofax/NaBL SemanticIndex /view/Spoofax/SemanticIndex?t=2013-02-01T09:12Z Introduction The semantic index is a set of stratego libraries, java primitives and editor extensions that provide a language-parametric framework for doing name ... (last changed by GuidoWachsmuth) 2013-02-01T09:12Z GuidoWachsmuth 1.3 updated major /rdiff/Spoofax/SemanticIndex /rdiff/Spoofax/SemanticIndex Support /view/Spoofax/Support?t=2013-01-28T13:06Z Documentation INCLUDE{Documentation} Open Issues We maintain a bugtracker with open issues at YellowGrass.org, but if you run into any issues you can also directly ... (last changed by EelcoVisser) 2013-01-28T13:06Z EelcoVisser 1.7 updated major /rdiff/Spoofax/Support /rdiff/Spoofax/Support SummerSchool /view/Spoofax/SummerSchool?t=2012-07-23T06:31Z Spoofax works best with a clean Eclipse Classic 3.7.2, download and install it here: http://www.eclipse.org/downloads/packages/eclipse-classic-372/indigosr2 Inside ... (last changed by GabrielKonat) 2012-07-23T06:31Z GabrielKonat 1.4 updated major /rdiff/Spoofax/SummerSchool /rdiff/Spoofax/SummerSchool TemplateLanguage /view/Spoofax/TemplateLanguage?t=2012-04-09T04:45Z TOC About The "template language" is a language that aims to eliminate redundancy in the specification of grammar, completion templates, and pretty printer. It borrows ... (last changed by TobiVollebregt) 2012-04-09T04:45Z TobiVollebregt 1.5 updated major /rdiff/Spoofax/TemplateLanguage /rdiff/Spoofax/TemplateLanguage SpoofaxLanguage /view/Spoofax/SpoofaxLanguage?t=2012-03-24T14:30Z !SpoofaxLang is a meta-language that can used to define new languages. It is currently an on-going project at the Delft University of Technology, The Netherlands. ... (last changed by TobiVollebregt) 2012-03-24T14:30Z TobiVollebregt 1.1 updated major /rdiff/Spoofax/SpoofaxLanguage /rdiff/Spoofax/SpoofaxLanguage Refactorings /view/Spoofax/Refactorings?t=2012-01-26T13:42Z Refactorings Spoofax helps you to enrich your editor with refactorings. You can find the refactorings in the context menu of the file being edited. http://strategoxt ... (last changed by MaartjeDeJonge) 2012-01-26T13:42Z MaartjeDeJonge 1.4 updated major /rdiff/Spoofax/Refactorings /rdiff/Spoofax/Refactorings TestingDemo /view/Spoofax/TestingDemo?t=2011-12-20T14:51Z See Testing instead. (last changed by LennartKats) 2011-12-20T14:51Z LennartKats 1.6 updated major /rdiff/Spoofax/TestingDemo /rdiff/Spoofax/TestingDemo Research /view/Spoofax/Research?t=2011-12-18T08:20Z Publications See also the publication list on researchr The Spoofax Language Workbench Lennart C. L. Kats, Rob Vermaas, Eelco Visser. Integrated Language Definition ... (last changed by MaartjeDeJonge) 2011-12-18T08:20Z MaartjeDeJonge 1.17 updated major /rdiff/Spoofax/Research /rdiff/Spoofax/Research Tour /view/Spoofax/Tour?t=2011-11-28T14:37Z This page provides a tour of the different features of Spoofax. For additional supporting material and documentation, visit our page. For a quick overview of features ... (last changed by LennartKats) 2011-11-28T14:37Z LennartKats 1.22 updated major /rdiff/Spoofax/Tour /rdiff/Spoofax/Tour

Number of topics: 0

  • Jump to topic: If you already know the name of the topic, enter the name of the topic into the GoBox at the top

  • WebChanges: Find out what topics in Spoofax have changed recently

  • Advanced search:
    Topic text (body)     Search web(s)
    Topic name Sort by in reversed order

    Make search: Case sensitive RegularExpression search (semicolon ';' for and)
    Don't show: search string summaries     total matches
    Do show: BookView locked topic   topics (result count)

  • Jump to topic: If you already know the name of the topic, enter the name of the topic into the GoBox at the top

  • WebChanges: Find out what topics in Spoofax have changed recently

-- TWiki:Main.PeterThoeny - 18 Jan 2004

Statistics for TWiki.Spoofax Web

Month: Topic
views:
Topic
saves:
File
uploads:
Most popular
topic views:
Top contributors for
topic save and uploads:

Notes:

  • Do not edit this topic, it is updated automatically. (You can also force an update)
  • TWikiDocumentation tells you how to enable the automatic updates of the statistics.
  • Suggestion: You could archive this topic once a year and delete the previous year's statistics from the table.
Finding topics

Tracking activity

Look and feel

  • WebPreferences: values of variables
  • WebContents?: web specific entries in the side bar

Number of topics: 51